module.exports = app => {
  const mongoose = app.mongoose;
  const UserSchema = new mongoose.Schema({
    username: {
      type: String,
      unique: true,
      index: true
    },
    email: {
      type: String,
      unique: true
    },
    password: {
      type: String
    },
    headImage: {
      type: String
    },
    insert_time: {
      type: Date
    },
    last_time: {
      type: Date
    },
    token: {
      type: String
    }
  });

  return mongoose.model('User', UserSchema);
}